package example;

// static成员在编译时就创建好了
// 成员变量比构造函数优先初始化
// 继承后，初始化及static的创建 父类优先子类，
// 函数声明相同优先用子类


class parent
{
    int i = 9;
    int j;
    parent()
    {
        System.out.println("i = "+i);
        j = 39;
        System.out.println("j = "+j);
    }
    static int x = prt("static parent.x initialized");
    static int prt(String s)
    {
        System.out.println(s);
        return 47;
    }
}
public class GetToKnowConstructingOrder extends parent{
    int k = prt("GetToKnowConstructingOrder.k initialized");
    GetToKnowConstructingOrder()
    {
        prt("k = "+k);
        prt("j = "+j);
    }
    static int y = prt("GetToKnowConstructingOrder.y initialized");
    static int prt(String s)
    {
        System.out.println(s);
        return 63;
    }
    public static void main(String[] args)
    {
        prt("GetToKnowConstructingOrder constructor");
        GetToKnowConstructingOrder s = new GetToKnowConstructingOrder();
    }
}
